//
//  UserHeaderTableViewCell.swift
//  BusinessIOS
//
//  Created by Rain on 2018/11/20.
//  Copyright © 2018 XingJian Li. All rights reserved.
//

import UIKit

class UserHeaderTableViewCell: UITableViewCell {

    var nameLabel:UILabel!
    
    var namesLabel:UILabel!
    
    var HeadeImgView:UIImageView!
    
    
    var label1:UserHeaderButton!
    
    var label2:UserHeaderButton!
    
    var label3:UserHeaderButton!
    
    var label4:UserHeaderButton!
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    
    }
    
    

    
    required init?(coder aDecoder: NSCoder) {
        
        super.init(coder: aDecoder)
        
    }
    
    
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
        self.lauoutUI()
    }
    
    func lauoutUI(){
        
        nameLabel = UILabel()
        
        nameLabel.text = "冯元宇"

        nameLabel.textColor = UIColor.white
        nameLabel.font = UIFont.systemFont(ofSize:20)//一般方法
        self.contentView.addSubview(self.nameLabel!)
        
        
        namesLabel = UILabel()
        
        namesLabel.text = ""
        namesLabel.textColor = UIColor.white
        namesLabel.font = UIFont.systemFont(ofSize:12)//一般方法
        self.contentView.addSubview(self.namesLabel!)
        
        
        self.HeadeImgView = UIImageView()
       
        
        self.HeadeImgView.layer.cornerRadius = 30
        self.HeadeImgView.layer.masksToBounds = true
        self.addSubview(self.HeadeImgView)
        
        
        
        
        label1 = UserHeaderButton(type:.custom)

        label1.tag = 101
        label1.backgroundColor = UIColor.white
        self.contentView.addSubview(self.label1!)
        
        label2 = UserHeaderButton(type:.custom)
        label2.backgroundColor = UIColor.white
        label2.tag = 102
        self.contentView.addSubview(self.label2!)
        
        label3 = UserHeaderButton(type:.custom)
        label3.backgroundColor = UIColor.white
        label3.tag = 103
        self.contentView.addSubview(self.label3!)
        
        label4 = UserHeaderButton(type:.custom)
        label4.backgroundColor = UIColor.white
        label4.tag = 104
        self.contentView.addSubview(self.label4!)
        
   
        
        
        
        
        
        
        
    }
    
    override func layoutSubviews() {
        
        super.layoutSubviews()
        
        let aaa = self.frame.size.width/4
        
        self.nameLabel.frame = CGRect(x: 20, y: 30, width: self.frame.size.width - 120, height: 30)
        
        self.namesLabel.frame = CGRect(x: 20, y: 60, width: self.frame.size.width - 120, height: 30)
        self.HeadeImgView.frame = CGRect(x:self.frame.size.width - 80 , y: 30, width: 60, height: 60)
        
        self.label1.frame = CGRect(x: 0, y: self.frame.size.height - 50, width: aaa, height: 50)
        self.label2.frame = CGRect(x: aaa , y: self.frame.size.height - 50, width: aaa, height: 50)
        self.label3.frame = CGRect(x: aaa * 2, y: self.frame.size.height - 50, width: aaa, height: 50)
        self.label4.frame = CGRect(x: aaa * 3, y: self.frame.size.height - 50, width: aaa, height: 50)
        
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
    
    
    

}
